<?php

$includes_path = STYLESHEETPATH . '/includes/';

require_once ($includes_path . 'plugins.php');
require_once ($includes_path . 'admin.php');
require_once ($includes_path . 'template-tags.php');

// Initialize theme settings
add_action( 'after_setup_theme', 'omw_theme_setup' );

function omw_theme_setup() {

	add_theme_support( 'post-thumbnails' );

	// Remove RSD link
	remove_action('wp_head', 'rsd_link');
	// Remove Windows Live Writer link
	remove_action('wp_head', 'wlwmanifest_link');
	// Remove WP generator link
	remove_action('wp_head', 'wp_generator');
	// Remove post relational links
	remove_action('wp_head', 'start_post_rel_link');
	remove_action('wp_head', 'index_rel_link');
	remove_action('wp_head','parent_post_rel_link');
	remove_action('wp_head', 'adjacent_posts_rel_link_wp_head');
	remove_action('wp_head', '_ak_framework_meta_tags');
	
	// Remove links to the general feeds: Post and Comment Feed
	remove_action( 'wp_head', 'feed_links', 2 ); 
	remove_action( 'wp_head', 'feed_links_extra', 3 ); 

}

if (!is_admin()) {
	add_action( 'wp_print_scripts', 'omw_load_javascript' );
};

// enqueue scripts
function omw_load_javascript() {
   wp_deregister_script('jquery'); 
   wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"), false ,'1.4.2', true); 
   wp_enqueue_script('jquery', true);
   wp_enqueue_script( 'doubletap', get_bloginfo('template_directory').'/_ui/js/jquery.doubletap.js', array( 'jquery' ), '1.0', true );
   wp_enqueue_script( 'Hyphenator', get_bloginfo('template_directory').'/_ui/js/Hyphenator.js', array( 'jquery' ), '3.2', true );
   wp_enqueue_script( 'Cookies', get_bloginfo('template_directory').'/_ui/js/jquery.cookie.js', array( 'jquery' ), '1.4', true );
   wp_enqueue_script( 'bibliotype', get_bloginfo('template_directory').'/_ui/js/bibliotype.js', array( 'jquery' ), '1.0', true );
	if(get_bibliotype_debug_enabled()) {
   		wp_enqueue_script( 'bibliotype-debug', get_bloginfo('template_directory').'/_ui/js/bibliotype-debug.js', array( 'bibliotype' ), '1.0', true); 	
	}
}

?>